---
layout: "default"
title: "anyGenerator"
description: "Swift documentation for func 'anyGenerator'."
keywords: "anyGenerator,func,swift,documentation"
root: "/v2.2"
---

<div class="declaration" id="func-anygenerator-g_-generatortype_-g">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-anygenerator-g_-generatortype_-g">func <wbr>anyGenerator&lt;G : GeneratorType&gt;(<wbr>_: G)</a>
        
<div class="comment collapse" id="comment-func-anygenerator-g_-generatortype_-g"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func anyGenerator&lt;G : GeneratorType&gt;(base: G) -&gt; AnyGenerator&lt;G.Element&gt;</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-anygenerator-element_-element">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-anygenerator-element_-element">func anyGenerator&lt;Element&gt;(<wbr>_: () -&gt; Element?)</a>
        
<div class="comment collapse" id="comment-func-anygenerator-element_-element"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func anyGenerator&lt;Element&gt;(body: () -&gt; Element?) -&gt; AnyGenerator&lt;Element&gt;</code>
    
    
</div></div>
</div>
